<?php

/**
 * [PHPFOX_HEADER]
 */
defined('PHPFOX') or exit('NO DICE!');

/**
 * 
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author  		Raymond Benc
 * @package 		Phpfox_Component
 * @version 		$Id: list.class.php 5485 2013-03-11 09:44:15Z Miguel_Espinoza $
 */
class Connectsocial_Component_Block_Connect extends Phpfox_Component {

    /**
     * Class process method wnich is used to execute this component.
     */
    public function process() {
        $aConfigs = Phpfox::getService('connectsocial.oauth')->getConfig();
        
        $aActiveSocial = array();
        
        if(is_array($aConfigs)) {
            foreach($aConfigs['providers'] as $sProvider => $aConfig) {
                if($aConfig['enabled']) {
                    $aActiveSocial[] = $sProvider;
                }
            }
        }
        
        $this->template()->assign(array(
            'aActiveSocial' => $aActiveSocial
        ));
    }

    /**
     * Garbage collector. Is executed after this class has completed
     * its job and the template has also been displayed.
     */
    public function clean() {
        (($sPlugin = Phpfox_Plugin::get('takepicture.component_block_list_clean')) ? eval($sPlugin) : false);
    }

}

?>